package com.netease.spring.postprocessor;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
	public static void main(String[] args) {
		/*
		ClassPathResource resource = new ClassPathResource("postprocessor.xml");
		ConfigurableBeanFactory factory = new XmlBeanFactory(resource);
		BeanPostProcessor postProcessor = new Fuddifier();
		factory.addBeanPostProcessor(postProcessor);
		Rabbit r = (Rabbit) factory.getBean("rabbit");
		System.out.println(r.getDescription());
		*/
		
		ApplicationContext context = new ClassPathXmlApplicationContext("postprocessor.xml");
		Rabbit r = (Rabbit) context.getBean("rabbit");
		System.out.println(r.getDescription());
		
	}
}
